package top.catblog.notebook.entity.util;

import lombok.Data;

@Data
public class ResponseResult<T> {
    private String code;
    private String message;
    private T data;

    public ResponseResult(String code,String message){
        this.code = code;
        this.message = message;
    }

    public ResponseResult(String code,String message,T data){
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static ResponseResult SUCCESS(){
        return new ResponseResult("200","虽然成功了,但是后端什么都没有给你");
    }

    public static <T> ResponseResult SUCCESS(T data){
        return new ResponseResult("200","成功了,我会给你新的方法",data);
    }


    public static  ResponseResult FAILED(String errCode,String message){
        return new ResponseResult(errCode,message);
    }

}
